package com.gitee.wsl.mathematics.vector.ext

import com.gitee.wsl.mathematics.vector.vec2.MutableVector2
import com.gitee.wsl.mathematics.vector.vec2.Vector2
import com.gitee.wsl.mathematics.vector.vec3.MutableVector3
import com.gitee.wsl.mathematics.vector.vec3.Vector3
import com.gitee.wsl.mathematics.vector.vec4.MutableVector4
import com.gitee.wsl.mathematics.vector.vec4.Vector4

operator fun<T:Number> MutableVector2<T, *>.minusAssign(v: Vector2<T, *>) { x -= v.x ;y -= v.y }
operator fun<T:Number> MutableVector2<T, *>.timesAssign(v: Vector2<T, *>) { x *= v.x;y *= v.y }
operator fun<T:Number> MutableVector2<T, *>.divAssign(v: Vector2<T, *>) { x /= v.x;y /= v.y }
operator fun<T:Number> MutableVector2<T, *>.plusAssign(v: Vector2<T, *>) { x += v.x;y += v.y }

operator fun<T:Number> MutableVector3<T, *>.minusAssign(v: Vector3<T, *>) { x -= v.x;y -= v.y;z -= v.z }
operator fun<T:Number> MutableVector3<T, *>.plusAssign(v: Vector3<T, *>) { x += v.x;y += v.y;z += v.z }
operator fun<T:Number> MutableVector3<T, *>.timesAssign(v: Vector3<T, *>) { x *= v.x;y *= v.y;z *= v.z }
operator fun<T:Number> MutableVector3<T, *>.divAssign(v: Vector3<T, *>) { x /= v.x;y /= v.y;z /= v.z }


operator fun<T:Number> MutableVector4<T, *>.minusAssign(v: Vector4<T, *>) { x -= v.x;y -= v.y;z -= v.z;w -= v.w}
operator fun<T:Number> MutableVector4<T, *>.plusAssign(v: Vector4<T, *>) { x += v.x;y += v.y;z += v.z;w += v.w}
operator fun<T:Number> MutableVector4<T, *>.timesAssign(v: Vector4<T, *>) { x *= v.x;y *= v.y;z *= v.z;w *= v.w}
operator fun<T:Number> MutableVector4<T, *>.divAssign(v: Vector4<T, *>) { x /= v.x;y /= v.y;z /= v.z;w /= v.w}